<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=vue, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p :style="{fontSize:f50, color:red}">{{msg}}</p>
        <p :style="getStyle()">{{msg}}</p>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    msg: "闭关修炼",
                    f50:"50px",
                    red:"red",
                }
            },
            methods:{
                getStyle(){
                    return {fontSize:this.f50, background:this.red}
                }
            }
        }).mount("#app");
    </script>
</body>
</html>